package com.example.parkinglotmanagementsystem;

/**
 * 车辆基类
 * 包含了车辆的基本属性
 */
public abstract class Vehicle {
    /**
     * 车辆编号
     */
    private int id;
    /**
     * 车牌号
     */
    private String number;
    /**
     * 车辆制造公司
     */
    private String company;
    /**
     * 车辆购买时间
     */
    private String time;
    /**
     * 车辆型号
     */
    private String type;
    /**
     * 总公里数
     */
    private float totalKilo;
    /**
     * 耗油量
     */
    private float consumption;
    /**
     * 维护费用
     */
    private float maintenanceExpense;
    /**
     * 养路费
     */
    private float roadMaintenanceExpense;
    /**
     * 总费用
     */
    private float totalExpense;
    /**
     * 车辆管理器
     */
    VehicleManager manager;

    Bus bus;
    SedanCar sedanCar;
    Truck truck;

    public Vehicle() {
        id = 0;
        number = null;
        company = null;
        time = null;
        type = null;
        totalKilo = 0;
        consumption = 0;
        maintenanceExpense = 0;
        roadMaintenanceExpense = 0;
        totalExpense = 0;
        initVehicleManager();
    }

    public Vehicle(int id, String number, String company, String time, String type, float totalKilo, float consumption, float maintenanceExpense, float roadMaintenanceExpense, float totalExpense) {
        this.id = id;
        this.number = number;
        this.company = company;
        this.time = time;
        this.type = type;
        this.totalKilo = totalKilo;
        this.consumption = consumption;
        this.maintenanceExpense = maintenanceExpense;
        this.roadMaintenanceExpense = roadMaintenanceExpense;
        this.totalExpense = totalExpense;
    }

    /**
     * 初始化车辆管理器
     */
    public void initVehicleManager(){
        manager = new VehicleManager();
    }


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public float getTotalKilo() {
        return totalKilo;
    }

    public void setTotalKilo(float totalKilo) {
        this.totalKilo = totalKilo;
    }

    public float getConsumption() {
        return consumption;
    }

    public void setConsumption(float consumption) {
        this.consumption = consumption;
    }

    public float getMaintenanceExpense() {
        return maintenanceExpense;
    }

    public void setMaintenanceExpense(float maintenanceExpense) {
        this.maintenanceExpense = maintenanceExpense;
    }

    public float getRoadMaintenanceExpense() {
        return roadMaintenanceExpense;
    }

    public void setRoadMaintenanceExpense(float roadMaintenanceExpense) {
        this.roadMaintenanceExpense = roadMaintenanceExpense;
    }

    public float getTotalExpense() {
        return totalExpense;
    }

    public void setTotalExpense(float totalExpense) {
        this.totalExpense = totalExpense;
    }

    public abstract String getAllProperty();

    public abstract String getUniqueAttributes();
}
